package com.allwees.bs.c.module.order.util;

import com.allwees.bs.c.module.order.entity.OrderEntity;
import com.allwees.bs.c.module.order.entity.OrderFlowEntity;

public class OrderFlowUtil {

    public static OrderFlowEntity generate(OrderEntity order) {
        return generate(order, null, null);
    }

    public static OrderFlowEntity generate(OrderEntity order, Integer reason, String remark) {

        OrderFlowEntity orderFlow = new OrderFlowEntity();
        orderFlow.setOrderUuid(order.getUuid());
        orderFlow.setOrder(order);
        orderFlow.setAction(order.getLatestAction());
        orderFlow.setBackState(order.getBackState());
        orderFlow.setState(order.getState());
        orderFlow.setReason(reason);
        orderFlow.setRemark(remark);

        return orderFlow;
    }
}
